package com.megan.design.principle.liskovsubstitution;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: megan
 * @Data: 2018/8/23 上午7:55
 * @Description:
 */
@Slf4j
public class Test {
    public static void resize(Rectangle rectangle) {
        while (rectangle.getWidth() <= rectangle.getLength()) {
            rectangle.setWidth(rectangle.getWidth() + 1);
            log.info("width-->{},length -->{}", rectangle.getWidth(), rectangle.getLength());
        }
        log.info("resize 方法结束 width-->{},length -->{}", rectangle.getWidth(), rectangle.getLength());
    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.setWidth(10);
        rectangle.setLength(20);
        resize(rectangle);
    }

//    public static void main(String[] args) {
//        Square square = new Square();
//        square.setSidLength(10);
//        resize(square);
//    }


}
